PowerTCP Mail for .NET
Read(Byte[],Int32,Int32) Method
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > SegmentedStream Class > Read Method : Read(Byte[],Int32,Int32) Method




buffer
The storage location for the received data.
offset
The zero-based position in the buffer at which to store the received data.
count
The maximum number of bytes to read.
Read data from the stream into a byte array.

Syntax

Visual Basic (Declaration) 
Public Overloads Overrides Function Read( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal count As Integer _
) As Integer
Visual Basic (Usage)Copy Code
Dim instance As SegmentedStream
Dim buffer() As Byte
Dim offset As Integer
Dim count As Integer
Dim value As Integer
 
value = instance.Read(buffer, offset, count)
C# 
public override int Read( 
   byte[] buffer,
   int offset,
   int count
)
Managed Extensions for C++ 
public: int Read( 
   byte[]* buffer,
   int offset,
   int count
) override 
C++/CLI 
public:
int Read( 
   array<byte>^ buffer,
   int offset,
   int count
) override 

Parameters

buffer
The storage location for the received data.
offset
The zero-based position in the buffer at which to store the received data.
count
The maximum number of bytes to read.

Return Value

The total number of bytes read into the buffer.

Exceptions

ExceptionDescription
System.IO.IOExceptionThrown when the stream is not Readable.
System.ArgumentNullExceptionThrown when the receiving buffer is null.
System.ArgumentOutOfRangeExceptionThrown when the offset is less than zero or when count is less than or equal to zero.
System.ArgumentExceptionThrown when the (offset + count) > buffer.Length.

Remarks

This method will block (for ReceiveTimeout) until at least 1 byte is available for reading, or the connection is closed by the server, in which case an empty string is returned. The Charset property is used to convert from bytes to unicode characters, which allows unicode characters to be passed over the network.

The value returned may be less than the number of bytes requested if that many bytes are not currently available, or zero if the end of the stream has been reached. Applications must check this value to know how many bytes were read into the buffer.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.